home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
XLisp-Stat
/
Functions
/
pointproto.lsp
< prev
next >
Wrap
Text File
|
1990-10-11
|
737b
|
27 lines
; book pp.199-200
(defproto point-proto '(x y) '() compound-data-proto)
(defmeth point-proto :x (&optional (x nil set))
(if set (setf (slot-value 'x) x))
(slot-value 'x))
(defmeth point-proto :y (&optional (y nil set))
(if set (setf (slot-value 'y) y))
(slot-value 'y))
(defmeth point-proto :isnew (x y)
(send self :x x)
(send self :y y))
(defmeth point-proto :data-length () 2)
(defmeth point-proto :data-seq ()
(list (send self :x) (send self :y)))
(defmeth point-proto :make-data (seq)
(send point-proto :new (select seq 0) (select seq 1)))
(defmeth point-proto :print (&optional (stream t))
(format stream
"#<a point located at x = ~d and y = ~d>"
(send self :x)
(send self :y)))